layui.use('carousel',function(){
  let carousel = layui.carousel
    let arr = []
    $(function(){
  // console.log(1);
  function out (){
    $.ajax({
      type:'get',
      url:'http://192.168.151.23:8888/api/swipers',
      success:function(res){
        // console.log(res);
         if(res.status===0){
          //  console.log(1);
          res.data.forEach(item => {
            console.log(item);
            arr.push(`
            <li class="img-effect">
                    <a href="javascript:;">
                      <img src="${'http://192.168.151.23:8888/uploads/' + item.swiperimg}" alt="">
                    </a>
                  </li>
            `)
        });
         
        $('#kr_carousel ul').html(arr.join())
        carousel  .render({
          elem: '#kr_carousel',
          width: 720,
          height: 300,
          interval: 3000
        })
      }
    }
  })
}
out ()



function tuo (){
  console.log(1);
$.ajax({
  type:'GET',
  url:'http://192.168.151.23:8888/api/links',
  success:function(res){
    console.log(res.data);
     if(res.status===0){
       let arr = ['<dt>合作伙伴</dt>']
      // let str=''
      res.data.forEach(item=>{

        // str+=`
        //       <dd>
        //         <a href="javascript:;">
        //           <img src="${'http://192.168.151.23:8888/uploads/' + item.linkicon}" alt="${item.linkname}">
        //         </a>
        //       </dd>`
             
        arr.push(`
        <dd>
        <a href="javascript:;">
          <img src="${'http://192.168.151.23:8888/uploads/' + item.linkicon}" alt="${item.linkname}">
        </a>
      </dd>
        `)
      })
      // $('.kr_collaborator').html(str);
      // console.log(arr);
      $('.kr_collaborator').html(arr.join(''));
     }
  }
})
}
tuo()
  })
})